<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true"
    EnableEventValidation="false" CodeFile="ExportPayment.aspx.cs" Inherits="Admin_ExportPayment" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">

    <script type="text/javascript">
        function ClearForm() {
            $('#<%=tb_VoucherDateFrom.ClientID%>').val('');
            $('#<%=tb_VoucherDateTo.ClientID%>').val('');
            return false;
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <%--<script type="text/javascript">
        function ClearForm() {
            //$('#<%tb_AccCode.ClientID%>').text('');
            return false;
        }
    </script>--%>
    <table>
        <tr>
            <td>
                Voucher Date:
            </td>
            <td>
                <asp:TextBox ID="tb_VoucherDateFrom" runat="server" CssClass="text-input datepicker"></asp:TextBox>
                <asp:RequiredFieldValidator runat="server" ID="rfv_FromDate" ControlToValidate="tb_VoucherDateFrom"
                    Text="Required"></asp:RequiredFieldValidator>
            </td>
            <td>
                to
            </td>
            <td>
                <asp:TextBox ID="tb_VoucherDateTo" runat="server" CssClass="text-input datepicker"></asp:TextBox>
                <asp:RequiredFieldValidator runat="server" ID="rfv_ToDate" ControlToValidate="tb_VoucherDateTo"
                    Text="Required"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                Payment Type:
            </td>
            <td colspan="3">
                <data:EntityDropDownList runat="server" ID="ddl_PaymentType" DataTextField="Description"
                    DataValueField="PaymentTypeCode" CssClass="text-input" AutoPostBack="True" AppendNullItem="True"
                    NullItemText="<..Please select..>" OnSelectedIndexChanged="ddl_PaymentType_SelectedIndexChanged"
                    CausesValidation="True" />
                <asp:RequiredFieldValidator runat="server" ID="rfv_PaymentType" ControlToValidate="ddl_PaymentType"
                    Text="Required"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:Button ID="btn_Filter" runat="server" Text="Filter" CssClass="button" OnClick="btn_Filter_Click" />&nbsp;
                <asp:Button ID="btn_Clear" runat="server" Text="Reset" CssClass="button" OnClientClick="return ClearForm();"
                    CausesValidation="False" />
                <asp:Button ID="btn_Export" runat="server" Text="Export" CssClass="button" OnClick="btn_Export_Click" />&nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <asp:Label ID="lbl_Error" runat="server" Text="" ForeColor="Red" Font-Bold="True"></asp:Label>
            </td>
        </tr>
    </table>
    <h3>
        Export Payment
    </h3>
    <data:EntityGridView ID="grv_PaymentList" runat="server" AutoGenerateColumns="False"
        CssClass="exportgrid" AllowExportToExcel="True" AllowSorting="False" ExportToExcelText="Excel"
        PageSelectorPageSizeInterval="10" OnPageIndexChanging="grv_BatchList_PageIndexChanging"
        AllowMultiColumnSorting="False" DefaultSortColumnName="AccntCode" DefaultSortDirection="Ascending"
        RecordsCount="0" ExcelExportFileName="ReportPrinting" ShowGridOnEmptyData="False"
        OnExcelBeforeFormat="grv_BatchList_ExcelBeforeFormat">
        <Columns>
            <asp:BoundField DataField="TransType" HeaderText="TransType" SortExpression="TransType" />
            <asp:BoundField DataField="JeTypeSun" HeaderText="Je_Type_Sun" SortExpression="JeTypeSun" />
            <asp:BoundField DataField="VoucherNo" HeaderText="VoucherNo" SortExpression="VoucherNo" />
            <asp:BoundField DataField="TransactionDt" HeaderText="Transaction_dt" SortExpression="TransactionDt" />
            <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
            <asp:BoundField DataField="SunAcctCode" HeaderText="SUN_AcctCode" SortExpression="SunAcctCode" />
            <asp:BoundField DataField="AmtUsd" HeaderText="Amt_USD" SortExpression="AmtUsd" DataFormatString="{0:#,##0.00}">
                <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="AmtVnd" HeaderText="Amt_VND" SortExpression="AmtVnd" DataFormatString="{0:#,##0}">
                <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="DrCrInd" HeaderText="DrCr_Ind" SortExpression="DrCrInd" />
            <asp:BoundField DataField="AcctPeriod" HeaderText="AcctPeriod" SortExpression="AcctPeriod" />
            <asp:BoundField DataField="T0" HeaderText="T0" SortExpression="T0" />
            <asp:BoundField DataField="T1" HeaderText="T1" SortExpression="T1" />
            <asp:BoundField DataField="T2" HeaderText="T2" SortExpression="T2" />
            <asp:BoundField DataField="T3" HeaderText="T3" SortExpression="T3" />
            <asp:BoundField DataField="T4" HeaderText="T4" SortExpression="T4" />
            <asp:BoundField DataField="T5" HeaderText="T5" SortExpression="T5" />
            <asp:BoundField DataField="ExchgRate" HeaderText="ExchgRate" SortExpression="ExchgRate" />
            <asp:BoundField DataField="SunExportDt" HeaderText="SUN_Export_Dt" SortExpression="SunExportDt" />
            <asp:BoundField DataField="CaseFileNum" HeaderText="CaseFileNum" SortExpression="CaseFileNum" />
            <asp:BoundField DataField="PreparedBy" HeaderText="PreparedBy" SortExpression="PreparedBy" />
        </Columns>
    </data:EntityGridView>
</asp:Content>
